package com.neusoft.nepm.controller;

import com.neusoft.nepm.dto.AfPageRequestDto;
import com.neusoft.nepm.dto.PageResponseDto;
import com.neusoft.nepm.dto.SvRemarksDto;
import com.neusoft.nepm.dto.SvpageRequestDto;
import com.neusoft.nepm.po.AqiFeedback;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import com.neusoft.nepm.po.Supervisor;
import com.neusoft.nepm.service.ISupervisorService;

@RestController
@RequestMapping("/supervisor")
public class SupervisorController {

	@Autowired
	private ISupervisorService supervisorService;

	/****************** neps 工程 ********************/
	// 公众监督员登录接口
	@RequestMapping("/getSupervisorByIdByPass")
	public Supervisor getSupervisorByIdByPass(@RequestBody Supervisor supervisor) {
		return supervisorService.getSupervisorByIdByPass(supervisor);
	}

	// 公众监督员注册接口
	@RequestMapping("/saveSupervisor")
	public int saveSupervisor(@RequestBody Supervisor supervisor) {
		return supervisorService.saveSupervisor(supervisor);
	}
	
	//验证公众监督员端手机号码是否被注册接口
	@RequestMapping("/getSupervisorById")
	public Supervisor getSupervisorById(@RequestBody Supervisor supervisor) {
		return supervisorService.getSupervisorById(supervisor.getTelId());
	}


	@RequestMapping("/resetPasswordById")
	public String resetPasswordById(@RequestBody String telId) {
		supervisorService.resetPasswordById(telId);
		return "123";



	}

	@RequestMapping("/listSupervisorPage")
	public PageResponseDto<Supervisor> listSupervisorPage(@RequestBody SvpageRequestDto svPageRequestDto){

		System.out.println(svPageRequestDto.getSex());
		return supervisorService.listSupervisorPage(svPageRequestDto);
	}
	@RequestMapping("/addRemarksById")
	public String addRemarksById(@RequestBody SvRemarksDto svRemarksDto){

		System.out.println(svRemarksDto.getRemarks());
		return supervisorService.addRemarksById(svRemarksDto);
	}

	// 根据 telId 获取员工信息
	@GetMapping("/getById/{telId}")
	public Supervisor getSupervisorById(@PathVariable String telId) {
		return supervisorService.getSupervisorById(telId);
	}

	// 更新员工信息
	@PostMapping("/update")
	public String updateSupervisor(@RequestBody Supervisor supervisor) {
		supervisorService.updateSupervisor(supervisor);
		return "Success";
	}
	/****************** neps 工程 ********************/
}
